package constant

const (
	//下划线
	PUBLICKEY = "KDKKDKKSDFJASLFJA;LKSDFJADSFJOQWERUQWEOREWQJFDSKLJFASDJF"
	// Couchdb username and password
	COUCHUSERNAME = "couchadmin"
	COUCHPASSWORD = "adminpwd"
	// 本机ip

	// 状态列表
	SAVEED   = "saved"
	RESAVEED = "resaved"
	DEPLOYED = "deployed"
	CHANED   = "channeled"
	CCED     = "chaincodeed"

	// DBNAME
	DBNAME = "BAAS"
	// TABLENAME
	USERTABLE = "USER"

	// 证书根目录
	ROOTPATH   = "/var/certification"
	CONFIGPATH = "/var/config"
	YAMLPATH   = "/var/yaml"
	SDKPATH    = "/var/sdk"
	//sub service URL
	UPLOADURL   = "/file/upload"     //上传证书接口
	UPLOADTXURL = "/file/uploadById" //上传文件到指定证书目录
	//SDK
	SDKINSTALLURL = "/sdk/install"   //安装fabric sdk
	SHELLEXECURL  = "/shell/execute" //调用sdk接口
	// CHAINCODE
	CCUPLOADZIPURL = "/chaincode/uploadByZip"
	CCUPLOADGITURL = "/chaincode/uploadByGit"
	// Environtment
	SYSTEMINFOURL = "/system/info"
	CHECKIP       = "/environment/ip"
	CHECKURL      = "/environment/check"
	INSTALLURL    = "/environment/install"

	LUNCHURL  = "/program/start"
	STATUSURL = "/program/status"
	// system
	SYSTEMPERFORMURL = "/system/performance"
	DOCKERPERFORMURL = "/docker/performance"
	DOCKEREXEC       = "/docker/execute"
	SERVERPORT       = "1081"

	// SHELL 文件名称
	SHELLRESTART = "restart.sh"
	// SHELLGETIMAGE = "get-images.sh"
	// SHELLSETIMAGE = "set-images-latest.sh"

	// install docker
	INSTALLDOCKER        = "yum install docker -y;systemctl daemon-reload;systemctl restart docker.service;"
	INSTALLNODEJS        = "curl --silent --location https://rpm.nodesource.com/setup_9.x | bash -;yum install -y nodejs;yum install -y gcc-c++;npm install -g pm2;"
	INSTALLDOCKERCOMPOSE = "yum install -y epel-release;yum install -y python-pip;pip install docker-compose;"
	INSTALLGIT           = "yum install -y git;"
	INSTALLJQ            = "yum install -y jq;"

	// check envirement
	CHECKDOCKER        = "docker -v;"
	CHECKDOCKERCOMPOSE = "docker-compose -v;"
	CHECKNODE          = "node -v;"
	CHECKGIT           = "git -v;"
	CHECKJQ            = "jq -v;"

	// check port
	CHECKPORT      = "firewall-cmd --query-port=%s/tcp;"
	ADDPORT        = "firewall-cmd --permanent --add-port=%s/tcp;"
	REMOVEPORT     = "firewall-cmd --permanent --remove-port=%s/tcp;"
	RESTATFIREWALL = "firewall-cmd --reload;"
	STOPFIREWALL   = "systemctl stop firewalld;"

	// ubuntun install 命令
	U_INSTALLDOCKER        = "sudo apt-get install docker.io -y; sudo systemctl daemon-reload;sudo systemctl restart docker;"
	U_INSTALLNODEJS        = "sudo sh node.sh;sudo apt-get install -y nodejs;sudo apt-get install build-essential;sudo npm install -g pm2;"
	U_INSTALLDOCKERCOMPOSE = "sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose;sudo chmod +x /usr/local/bin/docker-compose"
	U_INSTALLGIT           = "sudo apt-get install -y git;"
	U_INSTALLJQ            = "sudo apt-get install -y jq;"

	// check envirement
	U_CHECKDOCKER        = "docker -v;"
	U_CHECKDOCKERCOMPOSE = "docker-compose -v;"
	U_CHECKNODE          = "node -v;"
	U_CHECKGIT           = "git -v;"
	U_CHECKJQ            = "jq -v;"

	// check port
	U_CHECKPORT      = "sudo ufw status verbose | grep %s"
	U_ADDPORT        = "sudo ufw allow %s/tcp"
	U_REMOVEPORT     = "sudo ufw delete allow %s/tcp"
	U_RESTATFIREWALL = "sudo ufw reload"
	U_STOPFIREWALL   = "sudo ufw disable"
	// dbname
	DB_USER    = "user"
	DB_SETUP   = "setup"
	DB_SDK     = "sdk"
	DB_RANDOM  = "random"
	DB_TELCODE = "telcode"
	DB_ANN     = "ann"
	DB_FEED    = "feed"
	DB_Log     = "log"

	ActiveCode = `<div style="padding: 6px;font-size: 16px;">
	<h1 style="margin: 0 0 7px;font-size: 19px;
  color: #333;
  line-height: 28px;">%s，您好！</h1>
	<p style="margin: 7px 0 18px;font-size: 16px;
  color: #333;line-height: 28px;">欢迎注册链佰BAAS平台！为了激活您的账户，请点击下面的按钮验证您的邮箱</p>
	<a target="_blank"
	  style="display:block;width: 140px;height:36px;font-size:16px;line-height:36px;text-align:center;color:#fff;background-color: #01a4ff;text-decoration: none;margin-bottom: 35px;"
	  href="http://192.168.0.237/account/active?s=%s">验证邮箱</a>
	<p style="font-size: 16px;
  color: #333;line-height: 28px;margin: 7px 0;">如果按钮不生效，请复制下面的链接到您的浏览器:</p>
	<span style="font-size:18px;color:#01a4ff;text-decoration: none;" >%s</span>
	<p style="margin: 7px 0 30px;font-size: 16px">如需帮助，请联系<a
	  style="color:#01a4ff;text-decoration: none;" href="">技术支持</a></p>
	<img style="vertical-align: middle;margin-right: 16px;"
		 src="" width="54" height="31" alt="">
	<a target="_blank" href="//lianbai.io" style="color:#01a4ff;text-decoration: none;" href="">链佰信息科技有限公司</a> <span
	style="color:#151515;">|</span> <a target="_blank"
	style="color:#01a4ff;text-decoration: none;" href="https://lianbai.io">链佰BAAS平台</a>`

	ForgotCode = `<div style="padding: 6px;font-size: 16px;">
	<h1 style="margin: 0 0 7px;font-size: 19px;
  color: #333;
  line-height: 28px;">%s，您好！</h1>
	<p style="margin: 7px 0 18px;font-size: 16px;
  color: #333;line-height: 28px;">感谢对链佰BAAS平台支持！为了重设账户密码，请点击下面的按钮修改密码</p>
	<a target="_blank"
	  style="display:block;width: 140px;height:36px;font-size:16px;line-height:36px;text-align:center;color:#fff;background-color: #01a4ff;text-decoration: none;margin-bottom: 35px;"
	  href="http://192.168.0.237/account/forgot?s=%s">修改密码</a>
	<p style="font-size: 16px;
  color: #333;line-height: 28px;margin: 7px 0;">如果按钮不生效，请复制下面的链接到您的浏览器:</p>
	<span style="font-size:18px;color:#01a4ff;text-decoration: none;" >%s</span>
	<p style="margin: 7px 0 30px;font-size: 16px">如需帮助，请联系<a
	  style="color:#01a4ff;text-decoration: none;" href="">技术支持</a></p>
	<img style="vertical-align: middle;margin-right: 16px;"
		 src="" width="54" height="31" alt="">
	<a target="_blank" href="//lianbai.io" style="color:#01a4ff;text-decoration: none;" href="">链佰信息科技有限公司</a> <span
	style="color:#151515;">|</span> <a target="_blank"
	style="color:#01a4ff;text-decoration: none;" href="https://lianbai.io">链佰BAAS平台</a>`
)
